﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using QXBook.Service;
using QXBook.Utils;
using QXBook.Model;

namespace Web.SysManage.Users
{
    public partial class UsersInfoView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(CommonUtils.Get("MemberID")))
                {
                    UsersInfo user = ServiceFactory.CreateInstance<UsersService>().GetUsersInfo(CommonUtils.ToInt(hUserID.Value));
                    this.DataBind(user);
                }
            }
        }

        private void DataBind(IModelBase model)
        {
            UsersInfo user = model as UsersInfo;
            sUserName.Text = user.UserName;
            sNickName.Text = user.NickName;
            sRealName.Text = user.RealName;
            sCardCode.Text = user.CardCode;
            sQQ.Text = user.QQ;
            sMSN.Text = user.MSN;
            sTelphone.Text = user.Telphone;
            sEmail.Text = user.Email;
        }
    }
}